package com.thread;

/**
 * @Author: 胡成
 * @Version: 0.0.1V
 * @Date: 2018/11/14
 * @Description: 类描述
 **/
public class LoginServlet {
    private static String usernameRef;
    private static String passwordRef;

    public synchronized static void doPost(String username,String password){
        try {
            usernameRef = username;
            if(username.equals("a")){
                Thread.sleep(5000);
            }
            passwordRef = password;
            System.out.println("username="+usernameRef+" password="+password);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
